<div id="menu">
	<ul class="menu">

	<?php
	include_once("template/DataProvider.php");
	$query = "SELECT * FROM danhmuc ";
	$result = DataProvider::ExecuteQuery($query);
	while($row = mysql_fetch_array($result)){ ?>
		<li style="cursor:default">
		<?php 
		if($row["MaDM"]==1){ ?>
			<a href="trangchu.php?act=1"><?php echo $row["TenDM"]; ?></a>
		<?php 
		}else { ?>
			<a><?php echo $row["TenDM"];?> </a>
			<ul>
			<?php 
			$query1 = "SELECT * FROM loaisp l WHERE l.MaDM =".$row["MaDM"].""; 
			$result1 = DataProvider::ExecuteQuery($query1);
			while($row1 = mysql_fetch_array($result1)){	?>
				<li> 
					<a href="trangchu.php?act=3&id=<?php echo $row1["MaLSP"]; ?>"> <?php echo $row1["TenLSP"] ?></a>
					<ul>
					<?php
					$query2 = "SELECT * FROM hangsx h, sanpham s WHERE h.MaHSX=s.MaHSX AND s.MaLSP= ".$row1["MaLSP"]." GROUP BY TenHSX";
					$result2 = DataProvider::ExecuteQuery($query2);
					while($row2 = mysql_fetch_array($result2)){	?>
						<li> <a href="trangchu.php?act=2&id1=<?php echo $row2["MaLSP"] ?>&id=<?php echo $row2["MaHSX"]; ?>"> <?php echo $row2["TenHSX"];?> </a> </li>
					<?php
					} ?>
					</ul>
				</li>
			<?php
			} ?>
			</ul>
           
		<?php
		} ?>
        
		</li>
        
	<?php
	} ?>
    <li><a href="#"> KHUYẾN MÃI</a></li>
    <li><a href="#">SỬA CHỮA</a></li> 
	</ul>
</div>
